<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Strict//EN">
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<title>Win32</title>
<link rel="stylesheet" type="text/css" href="../../style.css">
<style type="text/css">
.style1 {
	font-size: medium;
	letter-spacing: normal;
	background-color: #FFFFFF;
}
</style>
</head>
<body>

<h2>Win32 System Driver</h2>
<p>This driver was designed for the modern 
  Microsoft Windows in 32 bits or 64 bits (XP, 2003, Vista, 7, 8, and 10).</p>
<h3>DLL</h3>
<p>To use the IUP DLL, it is necessary to link the 
  application with the IUP.lib and IUPSTUB.lib libraries (for technical reasons, these libraries cannot be unified). Note that 
  iup.lib is a library specially generated to work with 
  iup.dll, and is usually distributed in the same directory as 
  iup.dll. The IUP DLL depends on the Visual Studio C++ Run Time Library, MSVCR[XX].DLL, 
according to the Visuall C++ that built the iup.dll. </p>
<p>For the program to work, IUP.dll must be inside a PATH directory. Usually the program does not need to be re-linked when 
  the DLL is updated.</p>
<h3>Tips</h3>
<h4>Inspecting Native Controls</h4>
<p>The <strong>Spy++</strong> tool distributed with Microsoft Visual Studio is 
very useful to inspect windows controls position, size and visibility. It can be 
found in the Visual Studio &quot;Tools&quot; menu. In a similar way you can also use the
<a href="../dlg/iuplayoutdialog.html">IupLayoutDialog</a> to show IUP controls 
attributes and callbacks, in a interactive display of the dialog layout.</p>
<h4>Dialog Contents Zoomed by the System</h4>
<p>In Windows 8.1, Microsoft introduces a feature to support High DPI screens. 
If your application does not declares it is DPI aware, and the user configure 
the screen resolution for values greater than 100%, Windows will report a 
resolution of 96 DPI for the application and it will scale the contents of the 
dialog accordingly to the scale factor (actual resolution in DPI/ 96). To avoid 
that include the Manifest file when building the executable. The &quot;iup.manifest&quot; 
file in the &quot;iup/etc&quot; folder already contains the necessary changes to declare 
the application DPI aware.</p>
<p>Text will look better if a high DPI setting is used. For standard monitors 
(1280x1024) you can use 120 DPI (125%), for FullHD (1920x1080) can use 144 DPI 
(150%), and for 4k (3840x2160) can use 192 DPI (200%). To be able to respond to 
these resolution changes the application should avoid using sizes in pixels 
(like: RASTERSIZE, GAP, MARGIN) use character sizes instead (like: SIZE, CGAP, 
CMARGIN). </p>
<p>But there is still a problem with the images. Usually applications use 16x16 images 
for toolbar buttons, in a 4k resolution this looks very small, so ideally the 
application should have at least 3 sets of buttons: 16x16, 24x24 and 32x32. We recommend using 24x24 images for toolbar buttons when the SCREENDPI 
(global attribute) is greater than 120 DPI (&gt; 125%), and 32x32 when greater than 
144 DPI (&gt; 150%). If that is not possible the global attribute IMAGEAUTOSCALE<b>
</b>and the <b>IupImage </b>attribute AUTOSCALE can be used to automatically 
scale images. Stock image size is already automatically selected 
and resized if necessary.</p>
<h4>UTF-8</h4>
<p>When IUP is built with UNICODE enabled, it is possible to specify strings in 
UTF-8. But the default is still to use the current locale. To use UTF-8 strings set the global attribute UTF8MODE to 
YES.</p>

<h4>LINK : warning defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library </h4>
<p>This is a message displayed by Visual C++ compilers when one or more 
libraries included for linking is not using the same C Run Time Library as the 
application. In the same Visual C++ compiler there are 4 different libraries 
resulting from the combination of 2 options: <strong>debug</strong>/<strong>release</strong> 
x <strong>dll</strong>/<strong>static</strong>.</p>
<p>
<span style="color: rgb(0, 0, 0); font-family: tahoma, verdana, arial, helvetica, geneva, sans-serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 20px; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); display: inline !important; float: none; ">
The default configuration when a new project is created uses the C Run Time 
Library in a DLL, options named &quot;Multi-threaded Debug DLL (/MDd)&quot; for the
<strong>Debug</strong> configuration and &quot;Multi-threaded DLL (/MD)&quot; for the
<strong>Release</strong> configuration. The IUP package that matches that 
configuration is the &quot;dll*&quot; packages.</span></p>
<p><span class="style1">If you want to use static libraries then use the options 
&quot;Multi-threaded Debug (/MTd)&quot;
<span style="color: rgb(0, 0, 0); font-family: tahoma, verdana, arial, helvetica, geneva, sans-serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 20px; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); display: inline !important; float: none;">
for the <strong>Debug</strong> configuration </span>and &quot;Multi-threaded (/MT)&quot;
<span style="color: rgb(0, 0, 0); font-family: tahoma, verdana, arial, helvetica, geneva, sans-serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 20px; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); display: inline !important; float: none;">
for the <strong>Release</strong> configuration. Then use the IUP packages named 
&quot;vc*&quot;.</span></span></p>
<p><span class="style1">The IUP pre-compiled packages do not have
<span style="color: rgb(0, 0, 0); font-family: tahoma, verdana, arial, helvetica, geneva, sans-serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 20px; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); display: inline !important; float: none;">
debug information, so even selecting the correct <strong>dll</strong>/<strong>static</strong> 
combination, the warning will also be displayed. In this case the warning is 
harmless. But if you really want to avoid the 
warning simply use the same option without the Debug information for Release and 
Debug configurations.</span></span></p>
<p><span class="style1">Finally one thing that is <strong>NOT</strong> recommended is to do what the 
linker warning suggests, to ignore the default libraries using the /NODEFAULTLIB 
parameter. Only use that parameter if you really know what you are doing, 
because using it you can create other linking problems.</span></p>
<h4>COM Initialization</h4>
<p><strong>IupOpen</strong> calls &quot;CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);&quot;, if you need another concurrency model call 
  CoInitializeEx with other options before calling <strong>IupOpen</strong>. Be aware that some features in some controls require 
  single-thread apartment, and they will stop working, this includes: <strong>IupFileDLg</strong> when selecting a folder, and 
<strong>IupOleControl</strong>.</p>
<h4>InitCommonCtrlEx Linker Error</h4>
<p>On Windows a common error occurs: 
  &quot;Cannot find function <b>InitCommonCtrlEx</b>()&quot;
  This error occurs if you forgot to add the
  comctl32.lib library to be linked with the program. This library is <b>not</b> usually in the 
  libraries list for the Visual C++, you must add it.</p>
<h4>Custom IupFileDlg </h4>
<p>To use some cursors and the preview area of <b>IupFileDlg</b> you must include the 
  &quot;iup.rc&quot; file into your makefile. Or include the contents of it into your resource file, you will need also to copy 
  the cursor files.</p>
<h4>Windows Native Controls Appearance</h4>
<p>By default the Win32 application will look like Windows XP Classic theme, 
even in Windows 10. To use the new themes in Windows XP and and newer Windows, 
the build must enable the Windows Visual Styles. It can be enabled using a manifest file. Uncomment the manifest file section in &quot;iup.rc&quot; file or copy 
  it to your own resource file (you will need also to copy the manifest file &quot;iup.manifest&quot; 
or &quot;iup64.manifest&quot;).</p>
<p>When using Visual C++ 8/9/10/... with a manifest file, configure the linker properties 
of your project to do NOT generate a manifest file or the Windows Visual 
Styles from the RC file won't work. Also when using Visual C++ 8/9/10/... you 
can avoid using the manifest by using the following pragma on your code:</p>
<pre>#pragma comment(linker,&quot;\&quot;/manifestdependency:type = 'win32' \
                                              name = 'Microsoft.Windows.Common-Controls' \
                                           version = '6.0.0.0' \
                             processorArchitecture = '*' \
                                    publicKeyToken = '6595b64144ccf1df' \
                                          language = '*'\&quot;&quot;)</pre>
<p>If your Windows is using the Windows Classic theme or any other theme, IUP 
controls appearance will follow the system appearance only if you are using the 
manifest. If not using the manifest, then it will always look like Windows Classic.</p>

<h4><b>Help in CHM format fail to open</b></h4>
<p>When you download a CHM file from the Internet Windows blocks your access to 
the file. You must unblock it manually. Right click the file in Explorer and 
select&nbsp; &quot;Unblock&quot; at the bottom of the dialog.</p>

<h4>Visual C++ 6</h4>
<p>Since 3.0 Visual C++6 is not supported, although we may still provide 
pre-compiled binaries. To compile the IUP 3 code 
with VC6 you will need to download a new
<a href="http://windowssdk.msdn.microsoft.com/">Platform SDK</a>, because the 
one included in the compiler is too old. But it cannot be a too new one also, 
because the compiler will report errors in the newest headers.</p>
<p>We recommend 
you to upgrade your compiler.
<a href="http://msdn.microsoft.com/vstudio/express/visualc/">Visual C++ Express 
Edition</a> is a free compiler that has everything VC6 had and more.</p>
<h4>Control ID (since 3.26)</h4>
<p>The attribute CONTROLID can be used to set the Windows control identifier. 
IUP automatically generates identifiers for controls inside the dialog starting 
at 100. When using this attribute start with a very large number to avoid 
conflicts with the generated idetifiers. </p>

</body>

</html>